package it.polimi.entities;

import it.polimi.entitiesDTO.PacketAttractionDTO;
import it.polimi.entitiesDTO.PersonalizedPacketAttractionDTO;

import java.io.Serializable;

import javax.persistence.*;


/**
 * The persistent class for the packet_attraction database table.
 * 
 */
@Entity
@Table(name="packet_attraction")
@NamedQuery(name="PacketAttraction.findAll", query="SELECT p FROM PacketAttraction p")
public class PacketAttraction implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int id;

	//bi-directional many-to-one association to Attraction
	@ManyToOne
	@JoinColumn(name="attraction")
	private Attraction attractionBean;

	//bi-directional many-to-one association to Packet
	@ManyToOne
	@JoinColumn(name="packet")
	private Packet packetBean;

	//bi-directional many-to-one association to PersonalizedPacket
	@ManyToOne
	@JoinColumn(name="personalizedPacket")
	private PersonalizedPacket personalizedPacket;

	public PacketAttraction() {
		super();
	}
	
	public PacketAttraction(Packet pack, Attraction attr){
		this.packetBean=pack;
		this.attractionBean=attr;
	}

	public PacketAttraction(PersonalizedPacket perspacket, Attraction a) {
		this.personalizedPacket=perspacket;
		this.attractionBean=a;
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Attraction getAttractionBean() {
		return this.attractionBean;
	}

	public void setAttractionBean(Attraction attractionBean) {
		this.attractionBean = attractionBean;
	}

	public Packet getPacketBean() {
		return this.packetBean;
	}

	public void setPacketBean(Packet packetBean) {
		this.packetBean = packetBean;
	}

	public PersonalizedPacket getPersonalizedPacket() {
		return this.personalizedPacket;
	}

	public void setPersonalizedPacket(PersonalizedPacket personalizedPacket) {
		this.personalizedPacket = personalizedPacket;
	}

}